using AutoMapper;
using UwinEducation.Application.Dtos;
using UwinEducation.Domain.Entities;

namespace UwinEducation.Application.Mappings
{
    /// <summary>
    /// 学生课表详情映射配置
    /// </summary>
    public class StudentScheduleDetailsProfile : Profile
    {
        public StudentScheduleDetailsProfile()
        {
            CreateMap<StudentScheduleDetails, StudentScheduleDetailsDto>()
                .ForMember(dest => dest.OrderId, opt => opt.MapFrom(src => src.OrderDetail.OrderId))
                .ForMember(dest => dest.Student, opt => opt.MapFrom(src => src.OrderDetail.Student))
                .ForMember(
                    dest => dest.TeacherSchedule,
                    opt => opt.MapFrom(src => src.OrderDetail.TeacherSchedule)
                )
                .ForMember(
                    dest => dest.TeacherScheduleDetails,
                    opt => opt.MapFrom(src => src.TeacherScheduleDetails)
                );

            CreateMap<CreateStudentScheduleDetailsDto, StudentScheduleDetails>();
            CreateMap<UpdateStudentScheduleDetailsDto, StudentScheduleDetails>();
        }
    }
}
